package com.javachmapi.springbootjsoup.constants;

import lombok.Data;

/**
 * create by 宋利军
 */
public enum Constants {

	SUCCESS(1,"成功"),
	FAILURE(1,"失败");

	private Integer code;

	private String name;

	Constants(Integer code, String name) {
		this.code = code;
		this.name = name;
	}

	public static String getName(Integer code,String name) {
		for (Constants c : Constants.values()) {
			if (c.getCode() == code) {
				return c.name;
			}
		}
		return null;
	}

	public Integer getCode() {
		return code;
	}

	public void setCode(Integer code) {
		this.code = code;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
}
